<?php
	
require_once './sys/viewLayer.php';
require_once './sys/dbLayer.php';
require_once './sys/sessionLayer.php';
require_once './sys/configLayer.php';
require_once './sys/mailLayer.php';
require_once './sys/functions.php';
require_once './sys/configParser.php';
require_once './sys/dataLayer.php';
require_once './config.php';

// checking config
$confFile = file('config.php');

if(empty($confFile))
{
	require 'install.php';
	die();
}

//Start
viewLayer::setup('deadtouch');
configParser::parse($CONFIGDIR, $CONFIGNAME);
dbLayer::connect( array(
	'host'=>configParser::getData('sql_host'),
	'user'=>configParser::getData('sql_user'),
	'password'=>configParser::getData('sql_pass'),
	'database'=>(strtolower(configParser::getData('sql_type')) == "sqlite")? 
		$CONFIGDIR.configParser::getData('sql_db') : configParser::getData('sql_db'))
	, strtolower(configParser::getData('sql_type')) );

?>